From: Claudio Cambra Date: Thu, 8 May 2025 05:50:00 +0000 (+0800) Subject: fix(macOS): Also send user agent over XPC service X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1^2~13^2^2^2~3 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=70070fe7935e17242009f3b7165191301662a58b;p=nextcloud-desktop.git fix(macOS): Also send user agent over XPC service Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationProtocol.h b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationProtocol.h index 6f7f0e24d..8e7242021 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationProtocol.h +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationProtocol.h @@ -23,7 +23,8 @@ - (void)configureAccountWithUser:(NSString *)user userId:(NSString *)userId serverUrl:(NSString *)serverUrl - password:(NSString *)password; + password:(NSString *)password + userAgent:(NSString *)userAgent; - (void)removeAccountConfig; - (void)createDebugLogStringWithCompletionHandler:(void(^)(NSString *debugLogString, NSError *error))completionHandler; - (void)getFastEnumerationStateWithCompletionHandler:(void(^)(BOOL enabled, BOOL set))completionHandler; diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationService.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationService.swift index 41670fe55..687c08ca9 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationService.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/ClientCommunicationService.swift @@ -48,15 +48,21 @@ class ClientCommunicationService: NSObject, NSFileProviderServiceSource, NSXPCLi completionHandler(accountUserId, nil) } - func configureAccount(withUser user: String, - userId: String, - serverUrl: String, - password: String) { + func configureAccount( + withUser user: String, + userId: String, + serverUrl: String, + password: String, + userAgent: String + ) { Logger.desktopClientConnection.info("Received configure account information over client communication service") - self.fpExtension.setupDomainAccount(user: user, - userId: userId, - serverUrl: serverUrl, - password: password) + self.fpExtension.setupDomainAccount( + user: user, + userId: userId, + serverUrl: serverUrl, + password: password, + userAgent: userAgent + ) } func removeAccountConfig() { diff --git a/src/gui/macOS/fileproviderxpc_mac.mm b/src/gui/macOS/fileproviderxpc_mac.mm index 227e48d65..b58fd7943 100644 --- a/src/gui/macOS/fileproviderxpc_mac.mm +++ b/src/gui/macOS/fileproviderxpc_mac.mm @@ -12,6 +12,7 @@ * for more details. */ +#include "common/utility.h" #include "fileproviderxpc.h" #include @@ -69,12 +70,14 @@ void FileProviderXPC::authenticateExtension(const QString &extensionAccountId) c NSString *const userId = account->davUser().toNSString(); NSString *const serverUrl = account->url().toString().toNSString(); NSString *const password = credentials->password().toNSString(); + NSString *const userAgent = QString::fromUtf8(Utility::userAgentString()).toNSString(); const auto clientCommService = (NSObject *)_clientCommServices.value(extensionAccountId); [clientCommService configureAccountWithUser:user userId:userId serverUrl:serverUrl - password:password]; + password:password + userAgent:userAgent]; } void FileProviderXPC::unauthenticateExtension(const QString &extensionAccountId) const